package tests;

import java.io.FileNotFoundException;
import java.io.IOException;

import exception.ExtraCharactersException;
import exception.IllegalCharacterSequenceException;
import exception.LessCharactersExeption;
import exception.NoRuleException;

import utilities.GraphCreator;
import model.ProgramGraph;
import model.TransitionSystem;

/** Class for testing reading from XML file
 * @author DarkoLaptop2
 *
 */
public class ReadXMLFileTest {
	/**Main method
	 * @param argv
	 * @throws IOException
	 * @throws IllegalCharacterSequenceException
	 * @throws LessCharactersExeption
	 * @throws NoRuleException
	 * @throws ExtraCharactersException
	 */
	public static void main(String argv[]) throws IOException, IllegalCharacterSequenceException, LessCharactersExeption, NoRuleException, ExtraCharactersException {
	
	    	TransitionSystem graph=GraphCreator.generateGraphWithoutVariables("graphs/nedetermisticki1.jff");
	    	System.out.println(graph.toStringTransitionPrint());
	    	for(String transition:graph.getAllTransitions())
	    		System.out.println(transition);
	    	System.out.println(graph.getAllBadNodes());
	    	System.out.println(graph.getInitialNode());
	    	
	    	ProgramGraph graph2=GraphCreator.generateGraphWithVariables("graphs/nedetermisticki1sopromenlivi.jff");
	    	for(String vari:graph2.getAllVariables())
	    		System.out.println(vari);
//	    	System.out.println(graph2.toStringTransitionPrint());
//	    	System.out.println(graph2.getInitialNode());
//	    	System.out.println(graph2.getInitialVariableValues());
	}
	    	
}
